#coding:utf-8
'''
* coder  : Dzlua
* email  : 505544956@qq.com
* module : api-frame
* path   : app/apis
* file   : token.py
* time   : 2017/10/21
'''
#--------------------#
from app import mgr
#----------#
from app.models.user import User
#--------------------#

#--------------------#
api = mgr.get_api_of_app()
#--------------------#

#--------------------#
class Token(mgr.ApiAuthBase):
    def post(self):
        token = mgr.g.user.auth_token(600)
        return {'token': token.decode('ascii'), 'duration': 600}
#--------------------#